﻿Option Strict On
Option Explicit On
Option Infer On

Imports System
Imports GenDotNet.TemplateSupport
Imports GenDotNet.Task.Common


Public Class CommentInfo
   Inherits BaseInfo

   Private mIsXmlComment As Boolean

   Public Sub New(ByVal comment As String, ByVal isXmlComment As Boolean)
      MyBase.New(comment, TemplateSupport.Scope.Unknown)
      Me.mIsXmlComment = isXmlComment
   End Sub

   Public Sub New(ByVal comment As String)
      Me.New(comment, False)
   End Sub

   Public Property IsXmlComment() As Boolean
      Get
         Return mIsXmlComment
      End Get
      Set(ByVal value As Boolean)
         mIsXmlComment = value
      End Set
   End Property

End Class


Namespace VB
   Public Module CommentInfoExtensions
      <Runtime.CompilerServices.Extension()> _
      Public Function Output( _
               ByVal info As CommentInfo) _
               As String
         Return <code>
         ' <%= If(info.IsXmlComment, "'''", String.Empty).WithSpace %><%= info.Name %><%= Strings.nl %>
                </code>.Value
      End Function

   End Module
End Namespace

Namespace CSharp
   Public Module CommentInfoExtensions
      <Runtime.CompilerServices.Extension()> _
      Public Function Output( _
               ByVal info As CommentInfo) _
               As String
         Return <code>
         // <%= If(info.IsXmlComment, "///", String.Empty).WithSpace %><%= info.Name %><%= Strings.nl %>
                </code>.Value
      End Function
   End Module
End Namespace
